101 research outputs found

    A principled approach to programming with nested types in Haskell

    Get PDF
    Initial algebra semantics is one of the cornerstones of the theory of modern functional programming languages. For each inductive data type, it provides a Church encoding for that type, a build combinator which constructs data of that type, a fold combinator which encapsulates structured recursion over data of that type, and a fold/build rule which optimises modular programs by eliminating from them data constructed using the buildcombinator, and immediately consumed using the foldcombinator, for that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types in Haskell. Specifically, the standard folds derived from initial algebra semantics have been considered too weak to capture commonly occurring patterns of recursion over data of nested types in Haskell, and no build combinators or fold/build rules have until now been defined for nested types. This paper shows that standard folds are, in fact, sufficiently expressive for programming with nested types in Haskell. It also defines buildcombinators and fold/build fusion rules for nested types. It thus shows how initial algebra semantics provides a principled, expressive, and elegant foundation for programming with nested types in Haskell

    Analysis of Residual Stresses in Laser-Shock-Peened and Shot-Peened Marine Steel Welds

    Get PDF
    Laser peening is now the preferred method of surface treatment in many applications. The magnitude and depth of the compressive residual stress induced by laser peening can be influenced strongly by the number of peen layers (the number of laser hits at each point) and by processing conditions including the use of a protective ablative layer. In this study, residual stresses have been characterized in laser and shot-peened marine butt welds with a particular focus at the fatigue crack initiation location at the weld toe. X-ray diffraction, synchrotron X-ray diffraction, incremental center-hole drilling, and the contour method were used for determination of residual stress. Results showed that the use of ablative tape increased the surface compressive stress, and the depth of compressive stress increased with an increase in number of peening layers. A key result is that variation of residual stress profile across laser peen spots was seen, and the residual stress magnitude varies between the center and edges of the spots

    Witnessing (co)datatypes

    Get PDF
    Datatypes and codatatypes are useful for specifying and reasoning about (possibly infinite) computational processes. The Isabelle/HOL proof assistant has recently been extended with a definitional package that supports both. We describe a complete procedure for deriving nonemptiness witnesses in the general mutually recursive, nested case—nonemptiness being a proviso for introducing types in higher-order logic

    Polymorphic Abstract Syntax via Grothendieck Construction

    Full text link
    Abstract. Abstract syntax with variable binding is known to be characterised as an initial algebra in a presheaf category. This paper extends it to the case of poly-morphic typed abstract syntax with binding. We consider two variations, second-order and higher-order polymorphic syntax. The central idea is to apply Fiore’s initial algebra characterisation of typed abstract syntax with binding repeatedly, i.e. first to the type structure and secondly to the term structure of polymorphic system. In this process, we use the Grothendieck construction to combine differ-ently staged categories of polymorphic contexts.
    corecore